package com.sikaryofficial.system.api;

import com.sikaryofficial.common.core.constant.ServiceNameConstants;
import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.system.api.domain.SysDictData;
import com.sikaryofficial.system.api.factory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 字典Feign接口服务
 *
 * @author qinjinyuan
 */
@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteDictService {
    /**
     * 根据类型查询字段数据
     *
     * @param dictType 字典类型
     * @return 结果
     */
    @GetMapping(value = "/dict/data/type/{dictType}", consumes = MediaType.APPLICATION_JSON_VALUE)
    R<List<SysDictData>> dictType(@PathVariable("dictType") String dictType);
}
